package com.medistat.dialog;

import java.util.ArrayList;
import java.util.List;

import com.medistat.model.enums.TypeOfWork;
import com.medistat.util.TypeOfWorkUtils;

/**
 * Dialog object for representing schedule line for Schedule GUI.
 *
 */
public class ScheduleSelection extends AbstractDialogObject implements Comparable<ScheduleSelection> {

	private boolean forDate=false;	//remove when sure
	private TypeOfWork typeOfWork;
	private List<ScheduleCell> scheduleCells = new ArrayList<ScheduleCell>();
	
	public TypeOfWork getTypeOfWork() {
		return typeOfWork;
	}
	public void setTypeOfWork(TypeOfWork typeOfWork) {
		this.typeOfWork = typeOfWork;
	}
	public List<ScheduleCell> getScheduleCells() {
		return scheduleCells;
	}
	public void setScheduleCells(List<ScheduleCell> scheduleCells) {
		this.scheduleCells = scheduleCells;
	}
	public void addToScheduleCells(ScheduleCell scheduleCell) {
		getScheduleCells().add(scheduleCell);
	}
	
	public String getTypeOfWorkDescription() {
		if(typeOfWork==null) {
			return "";
		}
		return TypeOfWorkUtils.getTypeOfWorKDescription(getTypeOfWork());
	}
	
	public boolean isForDate() {
		return forDate;
	}
	public void setForDate(boolean forDate) {
		this.forDate = forDate;
	}
	
	@Override
	public int compareTo(ScheduleSelection scheduleSelection) {
		return this.typeOfWork.compareTo(scheduleSelection.getTypeOfWork());
	}
}
